import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;

import java.util.List;

public class home4 {
    public static void main(String[] args) throws DocumentException {
        SAXReader Reader = new SAXReader();
        Document read = Reader.read("homewoek11\\src\\books.xml");
        Element rootElement = read.getRootElement();
        List<Element> elements = rootElement.elements();
        for (Element element : elements) {
            System.out.println(element.elementText("name"));
            System.out.println(element.elementText("publishingHouse"));
            System.out.println(element.elementText("dateOfPublication"));
            System.out.println(element.elementText("price"));

        }
    }


    }

